<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>


    <form action="" method="post">
        请输入年份：<input type="text" name='year'>
        <input type="submit" name='button' value="判断闰年">
    </form>
</body>
</html>

<?php
// if(isset($_POST["button"])){
// $day =$_POST['year'];
// if($day%4==0&&($day%100!=0 || $day%400==0)){
//     echo $day.'闰年';
// }else{
//     echo $day.'不是闰年';
// }
// }

if(!empty($_POST)){
    $year=$_POST['year'];
    if($year==''){
        echo '您没有输入年份';
    }else{
        if(is_numeric($year)){
            $year+=0;
            if(is_int($year)){
                if($year<1){
                    echo '年份必须正整数';
                }else{
                    if($year%4==0 && $year%100!=0 || $year%400==0)
                        echo "{$year}是闰年";
                    else
                        echo "{$year}是平年";
                }
            }else{
                echo'你输入的不是整数';
            }
        }else{
            echo'你输入的不是数字';
        }
    }
}
?>